home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / com_and3.zip / ALARM.CMD next >
OS/2 REXX Batch file  |  1989-10-09  |  7KB  |  191 lines

  1. ; ----- Install a tune as the default alarm
  2. ;    commenced: 8/2/88 R.McG
  3. ; ----------------------------------------------------------------
  4. ;    Note: This script creates the file COM-AND.TUN on the default
  5. ;    subdirectory (if no COM-AND= subdir, or if COM-AND.TUN already
  6. ;    exists on default), or on the COM-AND= subdir.
  7. ; ----------------------------------------------------------------
  8. ;
  9. ;    First, draw a box
  10. ;
  11.     LEGEND " Select an alarm tune"
  12.     ON ESCAPE GOSUB EXIT
  13.     GOTO Start
  14. ;
  15. ;    Subroutine to intercept ESCAPE
  16. ;
  17. Exit:
  18.     RESTORE         ; Restore saved screen area
  19.     EXIT            ; No window foolishness
  20. ;
  21. ;    Start by opening a window
  22. ;
  23. Start:
  24.     GOSUB Window        ; Open a window
  25. ;
  26. ;    Now, look for a keypress
  27. ;
  28. Loop:
  29.     KEYGET S1        ; Read a single key
  30.     SWITCH S1
  31.       CASE "1"              ; First call by Louis M. Sander
  32.         S0 = "T200MNO2G24O3C24E24G8G24G24G24G8E8E24E24E24E8C8E8C8O2G8"
  33.         PLAY S0        ; Play the current selection
  34.       ENDCASE
  35.       CASE "2"              ; William Tell
  36.         S0 = "t220l16o3mnb4p8msbbmnb4p8msbbb8g#8e8g#8b8g#8b8o4e8o3b8g#8e8g#8b8g#8b8o4e8o3mnb4p8msbb"
  37.         PLAY S0        ; Play the current selection
  38.       ENDCASE
  39.       CASE "3"              ; Theme from dragnet
  40.         S0 = "ms t250 o2 c2d8e-cp4 >c2d8e-cp4g-1 p2"
  41.         PLAY S0        ; Play the current selection
  42.       ENDCASE
  43.       CASE "4"              ; Leave it to Beaver
  44.         S0 = "ms t190lO2L8CL4FL8A>C<AFL4GL8B-L4>DL8C<B>CFL4D L8 <B- L4 G.. P16"
  45.         PLAY S0        ; Play the current selection
  46.       ENDCASE
  47.       CASE "5"              ; The TOnight Show
  48.         S0 = "ms t170 L4 A L8 G P16 F P16 L4 E P32 D.. P16.. L8 D.F P16 AG... P4"
  49.         PLAY S0        ; Play the current selection
  50.       ENDCASE
  51.       CASE "6"              ; Beverly Hillbillies
  52.         S0 = "ms t190 o2 L8 CCFCFGAAFF L4 G P32 G P32 C. P16"
  53.         PLAY S0        ; Play the current selection
  54.       ENDCASE
  55.       CASE "7"              ; The FLintstones
  56.         S0 = "ms t170 o3 L8 G.. P64 C P4 >C. P32 <AG.. P64 C P4 G. P64 FEEFG L4 CDC P32."
  57.         PLAY S0        ; Play the current selection
  58.       ENDCASE
  59.       CASE "8"              ; The Adams Family
  60.         S0 = "ms t220 o3 O3 T220 L8 CDEF P4 O0 L4 F P8 F P8 O3L8 DEF#G P4 O1 L4 G P8 G P8O3 L8 DEF#G P4 DEF#G P4 CDEF P4 O1 L4 F P8 F P8"
  61.         PLAY S0        ; Play the current selection
  62.       ENDCASE
  63.       CASE "9"              ; Final Jeapordy
  64.         S0 = "ms t150 o3 DGD <G >DGD P4DGDG MS B P8 MN L8 AGF#EE- L4DGD <G >DGD P4MS G P8"
  65.         PLAY S0        ; Play the current selection
  66.       ENDCASE
  67.  
  68.       CASE "A"              ; Birds
  69.         S0 = "l50 ml t255 o5 f#gf#gp64 f#gf#gp64 f#gf#gp64 f#gf#gp64 aa#ba#aa#ba#a p32 bbbbbb p64 f#gp64 f#gp64 f#gp64 f#gp64 f#g"
  70.         PLAY S0        ; Play the current selection
  71.       ENDCASE
  72.       CASE "B"              ; More birds
  73.         S0 = "l64 ml t255 n64n66n68n70 p64 n66n68n70n72n74n76n78 p64 n66n68n70n72 p64 n64n66n68n70 p64 n70n72n74n76n78n80 p64"
  74.         PLAY S0        ; Play the current selection
  75.       ENDCASE
  76.       CASE "C"              ; Charge
  77.         S0 = "mn t200 L8 CEFG P16 L8 E G8 >C1"
  78.         PLAY S0        ; Play the current selection
  79.       ENDCASE
  80.       CASE "D"              ; Spaceship
  81.         S0 = "l64 mf ml t255 n50n60n52n62n54n64n56n66n54n64n52n62n51n62"
  82.         PLAY S0        ; Play the current selection
  83.       ENDCASE
  84.       CASE "E"              ; More Spaceship
  85.         S0 = "l64 mf ml t255 n40n41n42n43 n50n51n52n53"
  86.         PLAY S0        ; Play the current selection
  87.       ENDCASE
  88.       CASE "F"              ; Alfred Hitchcock
  89.         S0 = "t200 ml o2g ms o3cc8c ml o2bab. ms o3 cd1"
  90.         PLAY S0        ; Play the current selection
  91.       ENDCASE
  92.       CASE "G"              ; Dixie
  93.         S0 = "t200 L16ge L8cc L16cdef L8gggeaaa. L16g a8.gab O4 L16cde4. c O3g O4c4.O3geg4.dec4"
  94.         PLAY S0        ; Play the current selection
  95.       ENDCASE
  96.       CASE "H"              ; Reveille by Louis M Sander
  97.         S0 = "T140O2G8O3MSC8MNE16C16O2G8O3MSE8C8MNE16C16O2G8O3E8C8E16C16O2G8O3E8C2"
  98.         PLAY S0        ; Play the current selection
  99.       ENDCASE
  100.       CASE "I"              ; Swim call by Louis M Sander
  101.         S0 = "T198 MN O2 G8 O3 C8 P8 C8 C8 E8 C8 O2 G8 P8 G8 G8 P8 G8 O3 C8 P8 C8 C8 E8 C8G"
  102.         PLAY S0        ; Play the current selection
  103.       ENDCASE
  104.  
  105.       CASE "P"
  106.         PLAY S0        ; Play the current selection
  107.       ENDCASE
  108.       CASE "X"
  109.         IF NOT NULL S0
  110.            GOTO INSTALL    ; Install it
  111.         ELSE
  112.            SOUND 200 100    ; NOthing yet
  113.            ENDIF
  114.       ENDCASE
  115.  
  116.       default
  117.         SOUND 100 100    ; Not acceptible
  118.       ENDCASE
  119.     ENDSWITCH
  120.     GOTO LOOP
  121. ;
  122. ;    Install the selection as the current tune
  123. ;
  124. INSTALL:
  125.     SET TUNE S0        ; Set for current execution
  126. ;
  127. ;    Construct a file name on the appropriate directory
  128. ;
  129.     ENVIRON S1 "COM-AND="   ; Look for COM-AND= environment var
  130.     IF FOUND        ; If environment variable found
  131.        LENGTH S1 N0     ; Get its length
  132.        N0 = N0-1        ; Point to last char in string
  133.        IF not STRCMP S1(n0:n0) "\"
  134.           N0 = N0+1
  135.           CONCAT S1(n0) "\"
  136.           ENDIF
  137.        ENDIF
  138.     S1 = S1&"COM-AND.TUN"   ; Add the necessary file name
  139. ;
  140. ;    Open the file, write the scting, and close it
  141. ;
  142.     FOPENO S1        ; Open the file name so constructed
  143.     LENGTH S0 N1        ; Find string length
  144.     WRITE S0 N1        ; Write the string
  145.     FCLOSEO         ; Close the file
  146.     MESSAGE "Alarm installed!"
  147.     RESTORE         ; Restore saved screen area
  148.     EXIT            ; And we're done
  149. ;
  150. ;    Open a window and display a menu
  151. ;
  152. Window:
  153.     SAVE  0 10 23 70
  154.     box   0 10 23 70 (default)
  155.     atsay 0 ,12 (default) " COM-AND Select Alarm tune "
  156.     atsay 1 ,11 (default)  " COM-AND version 2.3 allows the alarm 'tune' to be set by  "
  157.     atsay 2 ,11 (default)  " its user.  The alarm tune is set by default through the   "
  158.     atsay 3 ,11 (default)  " file COM-AND.TUN.  It may be changed during COM-AND's     "
  159.     atsay 4 ,11 (default)  " execution through any script using the command 'SET TUNE'."
  160.  
  161.     atsay 6 ,11 (default)  " This script both creates the TUN file and sets the alarm  "
  162.     atsay 7 ,11 (default)  " for the current execution.  ESC exits without installing. "
  163.  
  164.     atsay 8 ,10 (default) "├───────────────────────────────────────────────────────────┤"
  165.     atsay 10 12 (default) "1) First call"
  166.     atsay 11 12 (default) "2) William Tell"
  167.     atsay 12 12 (default) "3) Theme from Dragnet"
  168.     atsay 13 12 (default) "4) Leave it to Beaver"
  169.     atsay 14 12 (default) "5) The Tonight Show"
  170.     atsay 15 12 (default) "6) Beverly Hillbillies"
  171.     atsay 16 12 (default) "7) Flintstones"
  172.     atsay 17 12 (default) "8) The Adams Family"
  173.     atsay 18 12 (default) "9) Final Jeapordy"
  174. ; ***    atsay 19 12 (default) "9) And something completely different"
  175.  
  176.     atsay 10 42 (default) "A) Birds"
  177.     atsay 11 42 (default) "B) Another bird"
  178.     atsay 12 42 (default) "C) Charge!! "
  179.     atsay 13 42 (default) "D) Spaceship"
  180.     atsay 14 42 (default) "E) Another spaceship"
  181.     atsay 15 42 (default) "F) Alfred Hitchcock"
  182.     atsay 16 42 (default) "G) Dixie"
  183.     atsay 17 42 (default) "H) Reveille"
  184.     atsay 18 42 (default) "I) Swim call"
  185.  
  186.     atsay 20 10 (default) "├───────────────────────────────────────────────────────────┤"
  187.     atsay 21 12 (default) "P) Play the selected tune again"
  188.     atsay 22 12 (default) "X) Install the selected tune"
  189.     atsay 23 32 (default) "Press ESC to exit"
  190.     return
  191.